﻿@{
    Layout = null;
}

<form id="addUsersForm" method="post">
<table class="grid" width="100%" cellspacing="0" cellpadding="0">
	<!--基本信息-->
	<tbody>
	<tr>
		<td>用户名</td>
		<td>
            <input type="hidden" id="ID" name="ID" value="" />
		    <input type="text" id="UserName" name="UserName" class="easyui-textbox" data-options="required:true">
		</td>
        <td>真实姓名</td>
		<td>
			<input type="text" id="TrueName" class="easyui-textbox" name="TrueName" data-options="required:true">
		</td>
        <td>所属部室</td>
		<td>
			<input id="OfficeID" name="OfficeID" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'Name',
				url: '@Url.Content("~/Main/GetOffice")', 
				onLoadSuccess: function(rec){
					if(rec.length>0){
						$('#TheOffice').combobox('setValue',rec[0].ID);
					}
				},
                required:true" />   
		</td>
    </tr>
    <tr>
        <td>用户级别</td>
		<td>
            <span class="radioSpan">
                <input type="radio" id="AuthID" name="AuthID" value="1"/>业务员 
                <input type="radio" id="AuthID" name="AuthID" value="2"/>内勤 
                <input type="radio" id="AuthID" name="AuthID" value="3"/>部室领导
                <input type="radio" id="AuthID" name="AuthID" value="4"/>单位领导
                <input type="radio" id="AuthID" name="AuthID" value="5"/>系统管理员
            </span>
		</td>
    </tr>
    <tr>
        <td>操作权限</td>
		<td colspan="5">
            <input type="hidden" id="MenuID" name="MenuID" value="" />
			<table id="userAuthTree" class="easyui-treegrid" title="TreeGrid Actions" style="width:400px;height:250px"
			        data-options="
				        iconCls: 'icon-ok',
				        rownumbers: true,
				        animate: true,
				        collapsible: true,
				        fitColumns: true,
				        url: '/system/getmenutree',
				        method: 'get',
				        idField: 'id',
				        treeField: 'Name',
                        singleSelect: false,
                        onLoadSuccess:function(){
                            if($('#MenuID').val()!=''){
							    var menulist = $('#MenuID').val().split(',');
							    for(var j=0;j<menulist.length;j++){
								    $('#userAuthTree').treegrid('selectRow',menulist[j]);
							    }
                            }
						}
			        ">
		        <thead>
			        <tr>
                        <th data-options="field: 'ck',checkbox:true">选择</th>                       
				        <th data-options="field:'Name'">菜单项</th>
				        <th data-options="field:'WebIcon'">图标</th>
				        <th data-options="field:'Url'">地址</th>
			        </tr>
		        </thead>
	        </table>
		</td>
    </tr>
</tbody>
</table>
</form>

